% J = rand(2,4);
% u = rand(4,1);
% u_p = rand(4,1);
% g = J*(u-u_p);

% wl1norm = zeros(400,1);
% 
% for i = 1:400
% 
% c1 = i/100;
% % c1 = 0.5;
% 
% cvx_begin
%     variables w(4)
%     minimize sum(abs(u-w))
%     subject to
%         J*w == c1*g
% cvx_end
% 
% wl1norm(i) = norm(w,1);
% 
% end

% for i=1:200

x0 = [0;1.01];
x1 = [1;0];

cvx_begin
    variables x(2)
    minimize square_pos(norm(x-x0, 2))
    subject to
        x(1) >= 1
        x'*x1 - norm(x,2)/sqrt(2) >= 0
cvx_end


% scatter(x(1), x(2), 1, 'b', 'filled'); % 100 is the marker size
% hold on
% axis equal
% xlim([-1,4]);
% ylim([-1,4]);
% end